package com.lagou.edu.boss.controller;

import com.lagou.edu.common.result.ResponseDTO;
import com.lagou.edu.dto.PromotionSpaceDTO;
import com.lagou.edu.remote.AdRemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * AdController
 *
 * @author zyt
 * @date 2021/2/20 20:24
 **/
@RestController
@RequestMapping("/ad")
public class AdController {
    
    @Autowired
    private AdRemoteService adRemoteService;
    
    @GetMapping("/space/getAllSpaces")
    public ResponseDTO<List<PromotionSpaceDTO>> getAllSpaces(){
        List<PromotionSpaceDTO> spaceDTOList = adRemoteService.getAllSpaces();
        return ResponseDTO.success(spaceDTOList);
    }
    
}
